#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import sys
import xml.etree.ElementTree as etree
from timelogic import Task

class TaskXMLParser:
    def __init__(self, datasource):
        self.tree = etree.parse(datasource)
    def listGroups(self):
        return self.tree.findall("//group")
    def listTasks(self):
        return self.tree.findall("//task")
    def findGroup(self, name):
        pass
    def findTask(self, name):
        pass

if __name__ == "__main__":
    th = TaskHelper("data/tasks.xml")
    for t in th.listTasks():
        print "%s %s" % (t.tag, t.attrib)

